<!DOCTYPE html>
<html>

	<head>
		<link rel="stylesheet" type="text/css" href="css/main.css" />
		<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
		<meta charset="UTF-8">
		<title>网管课设备维修进度看板</title>
	</head>

	<body>
		<?php
		$con = mysqli_connect("localhost", "root", "famio.cn@0625");
		if(!$con)
  			{
  				die('无法连接到数据库' . mysqli_error());
  			}
  		$db_selected = mysqli_select_db($con,"it");
		$sql = "SELECT * from worklist where isok=0";
		mysqli_query($con,"set names utf8");
		$result = mysqli_query($con,$sql);		
		?>
			<div class="header">
				<div class="header-container">网管课设备维修进度看板</div>
			</div>
			<div class="content">
				<div class="content-table">
					<table>
						<tr class="table-menu">
							<td>资产编号</td>
							<td>送修人姓名</td>
							<td>送修人工号</td>
							<td>送修人部门</td>
							<td>送修人电话</td>
							<td>故障说明</td>
							<td>预估完成时间</td>
							<td>接单人</td>
							<td>目前状态</td>
						</tr>
						<?php
						while($detail=mysqli_fetch_row($result))
							{
					?>
							<tr class="table-list">
								<td>
									<?php echo $detail[1]; ?>
								</td>
								<td>
									<?php echo $detail[2]; ?>
								</td>
								<td>
									<?php echo $detail[3]; ?>
								</td>
								<td>
									<?php echo $detail[4]; ?>
								</td>
								<td>
									<?php echo $detail[5]; ?>
								</td>
								<td>
									<?php echo $detail[6]; ?>
								</td>
								<td>
									<?php echo $detail[7]; ?>
								</td>
								<td>
									<?php echo $detail[8]; ?>
								</td>
								<?php 
									if($detail[9]==0){
										echo "<td style='background-color:#A52A2A;color:white;'><i class='fa fa-warning'></i> 待维修</td>";
									}
									if($detail[9]==1){
										echo "<td style='background-color:#FF8C00;color:white;'><i class='fa fa-wrench'></i> 维修中</td>";
									}
									if($detail[9]==2){
										echo "<td style='background-color:#008000;color:white;'><i class='fa fa-check'></i> 待领取</td>";
									}
								?>
							</tr>
							<?php
					 };
					 mysqli_close($con);
					?>
					</table>
				</div>
			</div>
			<script language="JavaScript">
				function myrefresh() {
					window.location.reload();
				}
				setTimeout('myrefresh()', 1000);
			</script>
	</body>
</html>